package _16define.exercise;

import java.util.Objects;

public class Demo2 {
    public static void main(String[] args) {

    }
}
class Animal{
    int age;
    String name;
    double price;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Animal animal = (Animal) o;
        return age == animal.age && Double.compare(animal.price, price) == 0 && Objects.equals(name, animal.name);
    }

}